package com.thunder.soft.common.base;

import android.util.Log;

import androidx.annotation.NonNull;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.util.Map;

public class BaseViewModel extends ViewModel implements DefaultLifecycleObserver {

    private static final String TAG = "BaseViewModel";

    private MutableLiveData<String> errorMsg = new MutableLiveData<>();

    protected MutableLiveData<Map<String, Object>> activityLiveData = new MutableLiveData<>();

    protected MutableLiveData<Integer> finishActivity = new MutableLiveData<>();

    @Override
    public void onCreate(@NonNull LifecycleOwner owner) {
        DefaultLifecycleObserver.super.onCreate(owner);
    }

    @Override
    public void onResume(@NonNull LifecycleOwner owner) {
        DefaultLifecycleObserver.super.onResume(owner);
    }

    public MutableLiveData<String> getErrorMsg() {
        return errorMsg;
    }

    public MutableLiveData<Map<String, Object>> getActivityLiveData() {
        return activityLiveData;
    }

    public MutableLiveData<Integer> getFinishActivity() {
        return finishActivity;
    }
}
